﻿using System;
using Castle.Facilities.TypedFactory;

namespace Mammoth.Factories
{
    public class CustomTypedFactoryComponentSelector : DefaultTypedFactoryComponentSelector
    {
        protected override Type GetComponentType(System.Reflection.MethodInfo method, object[] arguments)
        {
            if (arguments.Length > 0 && arguments[0] is Type)
            {
                var name = ((Type)arguments[0]);
                return name;
            }

            return base.GetComponentType(method, arguments);
        }
    }
}
